package com.fishery.memo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;

import java.sql.Time;
import java.util.Date;

@ApiModel(value = "定时提醒任务对象")
@TableName(value = "t_task_remind")
public class Task {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "任务编号")
    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    private String id;

    @ApiModelProperty(value = "任务提醒所要发送到的用户id")
    private String userId;

    @ApiModelProperty(value = "任务提醒内容")
    private String taskContent;

    @ApiModelProperty(value = "任务定时提醒的时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="HH:mm:ss")
    private Time taskTime;

    @ApiModelProperty(value = "任务定时提醒的为周几(0为每周的每天，其他表示为每周的第几天)")
    private Integer taskWeekday;

    @ApiModelProperty(value = "任务状态（0为暂停，1为执行中）")
    private Integer status;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    @ApiModelProperty(value = "逻辑删除,是1、否0")
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer isDeleted;

    @ApiModelProperty(value = "乐观锁")
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getTaskContent() {
        return taskContent;
    }

    public void setTaskContent(String taskContent) {
        this.taskContent = taskContent;
    }

    public Time getTaskTime() {
        return taskTime;
    }

    public void setTaskTime(Time taskTime) {
        this.taskTime = taskTime;
    }

    public Integer getTaskWeekday() {
        return taskWeekday;
    }

    public void setTaskWeekday(Integer taskWeekday) {
        this.taskWeekday = taskWeekday;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "Task{" +
                "id='" + id + '\'' +
                ", userId='" + userId + '\'' +
                ", taskContent='" + taskContent + '\'' +
                ", taskTime=" + taskTime +
                ", taskWeekday=" + taskWeekday +
                ", status=" + status +
                ", gmtCreate=" + gmtCreate +
                ", gmtModified=" + gmtModified +
                ", isDeleted=" + isDeleted +
                ", version=" + version +
                '}';
    }
}
